<?php	
	require_once('Commun.php');
	
	$results = PdoUtil::getInstance()->executeSelect("SELECT enquete.id, enquete.started_at, scenario.titre
													  FROM enquete INNER JOIN scenario
															ON enquete.id_scenario = scenario.id
													  WHERE etat = 2", array());
													  
    $reponse = array();
	
	for ($i = 0; $i < count($results); $i++) {
			array_push($reponse, array("id" => $results[$i]["id"], "titre" => utf8_encode($results[$i]["titre"])));
	}
	
	echo json_encode($reponse);
?>